import { inferAsyncReturnType } from '@trpc/server'
import { FetchCreateContextFnOptions } from '@trpc/server/adapters/fetch'
import { CreateNextContextOptions } from '@trpc/server/adapters/next'

export async function createContext(opts: FetchCreateContextFnOptions) {
  return {
    // 可以在这里添加数据库连接、认证信息等
    // session: opts.req.session,
  }
}

export type Context = inferAsyncReturnType<typeof createContext>